package com.czxy.Demo09;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        String[] arrA = {"a","b","c","d","e"};  // 给定数组
        String[] arrB = new String[arrA.length];    //  创建一个新的数组

        int count = 0;  // arrB的下标计数器
        for (int i = arrA.length-1; i >= 0  ; i--) {   //倒叙遍历改数组
            arrB[count] = arrA[i];  //  将数组中指定下标的值 存放到新数组中
            count++;
        }

        System.out.println("arrA数组中的元素为:"+Arrays.toString(arrA));
        System.out.println("arrB数组中的元素为:"+Arrays.toString(arrB));
    }
}
